<template>
<div>


<el-dialog title="成为会员①：缴纳保证金" :visible.sync="showIntables1">
  <el-form :model="userForm">
    <el-form-item label="输入缴纳的金额" :label-width="formLabelWidth">
      <el-input v-model="userForm.guartantee" autocomplete="off"></el-input>
    </el-form-item>

  </el-form>
  <div slot="footer" class="dialog-footer">
    <el-button @click="close">取 消</el-button>
    <el-button type="primary" @click="open">确 定</el-button>
  </div>
</el-dialog>

</div>
    

</template>
<script>
  export default {
    name: "",
    props:[
        "showIntables1",
    ],
    data() {
      return {
        userForm: {
          guartantee:'',
        },
        formLabelWidth: '120px'
      };
    },

    methods: {
        //通用关闭组件
        close(){
            this.showIntables1 = false;
        },
      open() {
          //发送ajax请求到后台，加载数据
          this.$ax.put('/epai/user/addVip',this.userForm).then((response)=>{//axios返回的response并不是后端响应数据，而是经过了封装，提供更为丰富的数据
              if(response.data.success){
                  alert("认证成功");
                  this.showIntables1 = false;
              }
              else{
                this.$notify({
                  title:'提示',
                  message:response.data.message,
                  type:'error',
                  duration:1000
                })
              } 
            });           
        },
        doopen(){
            this.showIntables1 = true;
        }
    }
  };
</script>
